#!/bin/bash
set -x
export VLLM_ENGINE_ITERATION_TIMEOUT_S=36000
export VLLM_RPC_TIMEOUT=36000000
export VLLM_ENFORCE_CUDA_GRAPH=0

XINFERENCE_MODEL_SRC=modelscope XINFERENCE_HOME=/xinference/xinference_cache xinference-local -H 0.0.0.0 -p 8000 &
while true; do
  if curl -s "http://localhost:8000" > /dev/null; then
    break
  else
    sleep 1
  fi
done

xinference launch --model-engine vllm -e "http://0.0.0.0:8000" --model-name qwen3 --size-in-billions 30  --model-format pytorch --model_path /home/weights/Qwen/Qwen3-30B-A3B --n-gpu 4 --replica 1 --trust-remote-code 1 --max_model_len $[32*1024] --enable_chunked_prefill --enable_prefix_caching 
PID1=$!
wait $PID1
wait


